package com.cyq.blog.controller;

import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.cyq.blog.entity.Blog;
import com.cyq.blog.entity.Comment;
import com.cyq.blog.service.CommentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;
import java.util.Set;
import java.util.zip.Inflater;

/**
 * @Author chenyeqing
 * @Date 2021/5/19 20:29
 */
@Slf4j
@Controller
public class CommentController {

    @Autowired
    private CommentService commentService;


    /**
     * 保存评论区提交的评论
     */
      @ResponseBody
    @PostMapping("/comment/saveComment")
    public boolean saveComment(Comment comment) {
        log.info("====进入了 提交评论 方法====");
        log.info("comment=>" + comment);

        boolean save = commentService.save(comment);
        return save;
    }






}
